home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Graphics / TVPaint / Rexx / Tree.rx < prev    next >
Encoding:
Text File  |  1995-11-07  |  854 b   |  77 lines

  1. /*    param line */
  2.  
  3. options results
  4.  
  5. address 'rexx_TVPaint'
  6.  
  7.  
  8.     Parse ARG m x1 y1 x2 y2 b
  9.  
  10.     if(y2>y1) then
  11.     do
  12.         e=x1
  13.         x1=x2
  14.         x2=e
  15.  
  16.         e=y1
  17.         y1=y2
  18.         y2=e
  19.     end
  20.  
  21.  
  22.     /* initialisation */
  23.     a.1=x1
  24.     b.1=y1
  25.     c.1=x2
  26.     d.1=y2
  27.     tv_line a.1 b.1 c.1 d.1
  28.     segpos=1
  29.     segnum=1
  30.     new=2
  31.  
  32.     /* nombre d'itérations */
  33.     loop=6
  34.  
  35.     /* nombre de nouveaux segments à chaque loop */
  36.     gene=2
  37.  
  38.     prog=10
  39.  
  40.  
  41.     do i=1 to loop
  42.  
  43.         say "loop" i "**************"
  44.  
  45.         do j=0 to segnum-1
  46.  
  47.             q=segpos+j
  48.  
  49.             /* ici on génère ce qui doit l'être pour chaque segments*/ 
  50.             do k=0 to gene-1
  51.  
  52.                 a.new=c.q
  53.                 b.new=d.q
  54.  
  55.                 e=c.q
  56.                 e=e+random(0,100,time('S'))-50
  57.                 c.new=e
  58.  
  59.                 e=d.q
  60.                 e=e-prog-random(0,30,time('S'))-10
  61.                 d.new=e
  62.  
  63.                 say a.new b.new c.new d.new
  64.                 tv_line a.new b.new c.new d.new
  65.  
  66.                 new=new+1
  67.             end
  68.             
  69.  
  70.         end
  71.         segpos=segpos+segnum
  72.         segnum=segnum*gene
  73.         prog=10
  74.  
  75.     end
  76.  
  77.